.license-keyboard {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #E6E8EB;
  z-index: 1000;

  .keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background-color: #fff;
    border-bottom: 1px solid #eee;

    .plate-preview {
      font-size: 36px;
      color: #333;
      font-weight: 500;
      letter-spacing: 2px;
    }

    .close-btn {
      color: #666;
      font-size: 28px;
      padding: 10px 20px;
      background: #f5f5f5;
      border-radius: 8px;

      &:active {
        background: #e0e0e0;
      }
    }
  }

  .keyboard-body {
    padding: 36px 24px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));

    .key-row {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-around;
      margin-bottom: 12px;

      &.province-row {
        .key-item {
          position: relative;
          padding-bottom: 16px;

          .triangle {
            position: absolute;
            bottom: 4px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 20px;
            color: #999;
          }
        }
      }

      .key-item {
        width: 62px;
        height: 76px;
        line-height: 76px;
        text-align: center;
        background-color: #fff;
        margin: 4px;
        border-radius: 8px;
        font-size: 32px;
        color: #333;
        font-weight: 500;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        transition: all 0.2s;

        &.province-item {
          height: 100px;  // 为三角符号留出空间
          line-height: 76px;
        }

        &.key-delete {
          width: 62px;  // 与其他按键同宽
          background: linear-gradient(180deg, #FF6B6B 0%, #EE5253 100%);
          color: #fff;
          font-size: 24px;

          &:active {
            background: linear-gradient(180deg, #EE5253 0%, #DD4244 100%);
          }
        }

        &:active {
          transform: translateY(2px);
          box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
          background: #f0f0f0;
        }
      }
    }
  }
}

// 适配 iPhone X 及以上机型底部安全区域
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .license-keyboard {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
